package entity

import (
	"database/sql"
)

type UserInfo struct {
	Uid      int
	Username string
	Password string
	Created  string
	RealName string
}

func ReadUserData(rows *sql.Rows) map[string]interface{} {
	var userMap map[string]interface{} = make(map[string]interface{}, 0)
	for rows.Next() {
		user := new(UserInfo)
		_ = rows.Scan(&user.Uid, &user.Username, &user.Password, &user.Created, &user.RealName)
		userMap[user.Username] = *user
	}
	return userMap
}
